package sgd.tp2.client.net;

import java.io.IOException;
import java.net.UnknownHostException;

import javax.xml.bind.JAXBException;

import sgd.tp2.api.net.CDRFormatType;

public abstract class Client implements Runnable {

	protected String serverAddress = "localhost";
	protected int serverPort = 1234;
	protected boolean running = true;
	protected CDRFormatType cdrFormatType = CDRFormatType.XML;

	public Client(CDRFormatType cdrFormatType, String serverAddress, int serverPort) {
		this.cdrFormatType = cdrFormatType;
		this.serverAddress = serverAddress;
		this.serverPort = serverPort;
	}

	public boolean isRunning() {
		return running;
	}

	public abstract void startClient() throws UnknownHostException, IOException;

	public abstract void stopClient();

	public abstract void sendMessage() throws IOException, JAXBException;
}
